app.controller('confirmAgainLand', function($element, ngDialog, $scope, $state, rest, user, uploadConf, tipService, uiLoad, $localStorage, $window) {
  var data = angular.copy($scope.ngDialogData, {});
  var token = $window.localStorage.getItem("token");
  $scope.params = {
    page: 1,
    rows: 20,
    search: false,
    nd: 1494221804416,
    order: "asc",
  };
  $scope.params2 = {
    landlordId: data.landlordId,
    pointPersonId: ""
  };

  rest.decoJava({
    url: '/tenancy-sys/admin/user/list',
    data: $scope.params,
    type: 'post',
    beforeSend: function(request) {
      request.setRequestHeader("token", token);
    },
    success: function(res) {
      if (res.code == 0) {
        // btn.text('分期业务申请中');
        console.log(res)
        $scope.userList = res.result.list;
      } else {

      }
    },
    error: function() {
      btn.removeClass('disabled');
    }
  });

  $scope.choosePosition = function(index, userList) {
    $scope.params2.pointPersonId = "";
    $scope.params2.pointPersonId = userList[index].id;
    console.log($scope.params2.pointPersonId);
  }

  //点击确定按钮
  $scope.modifySure = function() {
    rest.decoJava({
      url: '/tenancy-sys/landlord/pointPersonLandlordCheck',
      data: $scope.params2,
      type: 'post',
      beforeSend: function(request) {
        request.setRequestHeader("token", token);
      },
      success: function(res) {
        if (res.code == 0) {
          $scope.closeThisDialog({
            clickOk: true
          });
        } else {

        }
      },
      error: function() {
        // btn.removeClass('disabled');
      }
    });
  }

});